<?php

/**
 * EmailCampaignUserDetails form base class.
 *
 * @method EmailCampaignUserDetails getObject() Returns the current form's model object
 *
 * @package    ecrm
 * @subpackage form
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEmailCampaignUserDetailsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                          => new sfWidgetFormInputHidden(),
      'email_campaign_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmailCampaigns'), 'add_empty' => true)),
      'contant_information_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ContantInformation'), 'add_empty' => true)),
      'member_id'                   => new sfWidgetFormInputText(),
      'client_id'                   => new sfWidgetFormInputText(),
      'hard_bounce_date'            => new sfWidgetFormDate(),
      'hard_bounce_status_code'     => new sfWidgetFormInputText(),
      'hard_bounce_smtp_response'   => new sfWidgetFormInputText(),
      'hard_bounce_apparently_from' => new sfWidgetFormInputText(),
      'soft_bounce_date'            => new sfWidgetFormDate(),
      'soft_bounce_status_code'     => new sfWidgetFormInputText(),
      'soft_bounce_smtp_response'   => new sfWidgetFormInputText(),
      'soft_bounce_apparently_from' => new sfWidgetFormInputText(),
      'unsubscribe_date'            => new sfWidgetFormInputText(),
      'complaint_name'              => new sfWidgetFormInputText(),
      'complaint_date'              => new sfWidgetFormDate(),
      'created_at'                  => new sfWidgetFormDateTime(),
      'updated_at'                  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'email_campaign_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('EmailCampaigns'), 'required' => false)),
      'contant_information_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ContantInformation'), 'required' => false)),
      'member_id'                   => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'client_id'                   => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'hard_bounce_date'            => new sfValidatorDate(array('required' => false)),
      'hard_bounce_status_code'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'hard_bounce_smtp_response'   => new sfValidatorPass(array('required' => false)),
      'hard_bounce_apparently_from' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'soft_bounce_date'            => new sfValidatorDate(array('required' => false)),
      'soft_bounce_status_code'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'soft_bounce_smtp_response'   => new sfValidatorPass(array('required' => false)),
      'soft_bounce_apparently_from' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'unsubscribe_date'            => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'complaint_name'              => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'complaint_date'              => new sfValidatorDate(array('required' => false)),
      'created_at'                  => new sfValidatorDateTime(),
      'updated_at'                  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('email_campaign_user_details[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmailCampaignUserDetails';
  }

}
